<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<img src="../img/off.gif" id="light">//
<h1 id="title">黑马程序员</h1>//
  <script>//
    var light = document.getElementById( "light");//
    alert("我要换图片了");//
      light.src="../img/on.gif";//
       var title = document.getElementById("title");//
          title.innerHTML="传智播客";//
</script>//
</body>
</html>